//
//  ShiPinButton.m
//  ProJectB_1
//
//  Created by lanou3g on 16/8/16.
//  Copyright © 2016年 yangshukai. All rights reserved.
//

#import "ShiPinButton.h"
#import "Header.h"
#import "Masonry.h"


@interface ShiPinButton ()

@property (nonatomic,strong) UIImageView *imageVi;
@property (nonatomic,strong) UILabel *label1;
@property (nonatomic,strong) UILabel *label2;
@property (nonatomic,strong) UILabel *label3;
@end

@implementation ShiPinButton

- (instancetype)initWithFrame:(CGRect)frame {
    if (self = [super initWithFrame:frame]) {
        self.backgroundColor = [UIColor cyanColor];
        
        self.imageVi = [[UIImageView alloc]init];
        [self addSubview:self.imageVi];
        
        self.numberLabel = [[UILabel alloc]init];
        _numberLabel.font = [UIFont systemFontOfSize:14];
        
        [self addSubview:self.numberLabel];
        
        self.label1 = [[UILabel alloc]init];
        _label1.backgroundColor = [UIColor whiteColor];
        [self addSubview:_label1];
        
        self.label2 = [[UILabel alloc]init];
        _label2.backgroundColor = [UIColor whiteColor];
        [self addSubview:_label2];

        self.label3 = [[UILabel alloc]init];
        _label3.backgroundColor = [UIColor whiteColor];
        [self addSubview:_label3];
        }
    return self;
}

- (void)layoutSubviews {
    __weak typeof(self)weakSelf = self;
    _imageVi.image = [UIImage imageNamed:self.imageName];
    [_imageVi mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.offset(weakSelf.bounds.size.height / 4);
        make.left.offset(weakSelf.bounds.size.width / 5);
        make.width.offset(weakSelf.bounds.size.width / 5);
        make.height.offset(weakSelf.bounds.size.height / 2);
    }];
    [_numberLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.offset(weakSelf.bounds.size.height / 4);
        make.left.equalTo(weakSelf.imageVi.mas_right).offset(3);
        make.height.offset(weakSelf.bounds.size.height / 2);
    }];
    
    [_label1 mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.offset(0);
        make.left.offset(0);
        make.width.offset(selfSizeWidth);
        make.bottom.offset(0);
    }];
    
    [_label2 mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.offset(0);
        make.right.offset(0);
        make.width.offset(selfSizeWidth);
        make.bottom.offset(0);
    }];
    
    [_label3 mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.offset(0);
        make.right.offset(0);
        make.height.offset(2);
        make.bottom.offset(0);
    }];
    
}




@end
